package com.palfund.butterknife;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.palfund.butterknife.base.BaseActivity;

import java.util.ArrayList;

import butterknife.BindView;

public class ViewHolderActivity extends BaseActivity {
    @BindView(R.id.recyclerView)
    RecyclerView mRecyclerView;

    @Override
    protected void onCreate() {
        LinearLayoutManager manager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL,
                false);
        mRecyclerView.setLayoutManager(manager);
        RecyclerAdapter adapter = new RecyclerAdapter();
        mRecyclerView.setAdapter(adapter);
        ArrayList<String> list = new ArrayList<>();
        for (int i = 0; i < 30; i++) {
            list.add("item" + i);
        }
        adapter.insertItemRange(0, list);
    }

    @Override
    protected int getContentViewId() {
        return R.layout.activity_view_holder;
    }
}
